package com.ruoyi.manage.domain;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 仓库管理1对象 bm_warehouse
 *
 * @author ruoyi
 * @date 2022-11-13
 */
@Data
@NoArgsConstructor
@ToString
@TableName("bm_warehouse")
public class WareHouse extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 营业，休息 */
    private String status;
    private String statusType;

    /** 仓库编号 */
    @Excel(name = "仓库编号")
    private String warehouseCode;

    /** 仓库名称 */
    @Excel(name = "仓库名称")
    private String warehouseName;

    /** 机构id */
    private Long mechanismid;

    /**
     * 所属机构
     */
    @Excel(name = "所属机构")
    private String mechanismName;

    /** 仓库类型 1.自有 2.租赁 */
    private Long warehouseType;
    @Excel(name = "仓库类型")
    private String whTpyeName;
    private String whTpyeLabel;

    /** 仓库地址 */
    @Excel(name = "仓库地址")
    private String address;

    /** 物流费每公里 */
    @Excel(name = "物流费每公里")
    private BigDecimal deliveryFeeAveryKM;

    /** 开始营业时间 */
    @Excel(name = "开始营业时间")
    private String startTime;

    /** 结束营业时间 */
    @Excel(name = "结束营业时间")
    private String endTime;

    /** 配送范围 */
    @Excel(name = "配送范围")
    private BigDecimal deliveryRadius;

    /** 仓库经纬度坐标 如：113.781181,34.720848 */
    @Excel(name = "仓库经纬度坐标 如：113.781181,34.720848")
    private String mapCode;

    /** 联系电话 */
    @Excel(name = "联系电话")
    private String tel;

    /** 起送数量 */
    @Excel(name = "起送数量")
    private Long startSendNum;

    /** 删除标记 0.未删除 1.已删除 */
    @Excel(name = "删除标记 0.未删除 1.已删除")
    private Long isDeleted;

    public Long getWarehouseType() {
        return warehouseType;
    }

    public void setWarehouseType(Long warehouseType) {
        this.warehouseType = warehouseType;
        if (this.warehouseType.equals(1L)){
            this.whTpyeName = "";
            this.whTpyeLabel = "自营";
        }else {
            this.whTpyeName = "warning";
            this.whTpyeLabel = "租赁";
        }

    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
        if (this.status.equals("营业")){
            this.statusType = "success";
        }else {
            this.statusType = "danger";
        }
    }

}
